package com.freework.sys.dic.vo;

import com.freework.util.unmodifiableMap.KeysIndex;
import com.freework.util.unmodifiableMap.UnmodifiableKeyMap;

public class MyUnmodifiableKeyMap extends UnmodifiableKeyMap<Object> {

	
	public MyUnmodifiableKeyMap(KeysIndex keysIndex) {
		super(keysIndex);
	}
	public void putIndex(int index, Object value,PredefineVO vo) {
		if(values.length>index){
			values[index]=value;
			vo.addUpdateField(index);
		}
		//return value;
	}
	public Object put(String key, Object value,PredefineVO vo) {
		Integer index=	keysIndex.getIndex(key);
		if(index!=null){
			
			Object oldobj=(Object) values[index];
			values[index]=value;
			vo.addUpdateField(key);
			this.index++;
			return oldobj;
		}else{
			return null;
		}
	}
	
}
